﻿<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form reemplaza a Dispose para limpiar la lista de componentes.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Requerido por el Diseñador de Windows Forms
    Private components As System.ComponentModel.IContainer

    'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
    'Se puede modificar usando el Diseñador de Windows Forms.  
    'No lo modifique con el editor de código.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.DGV = New System.Windows.Forms.DataGridView()
        Me.FolioValeDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.NumsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.FechaVentaDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.FechaSurtidoDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.DenominacionDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.SerieDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.ClienteDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.NumvaleDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.EstadovtDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.FsDataGridViewTextBoxColumn = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.InfoValeBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        Me.DsAdmingasBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        Me.DsAdmingas = New Vales_Verificador_3.DSAdmingas1()
        Me.TxtVale = New System.Windows.Forms.RichTextBox()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.InfoValeTableAdapter = New Vales_Verificador_3.DSAdmingas1TableAdapters.InfoValeTableAdapter()
        Me.Bcopiar = New System.Windows.Forms.Button()
        Me.Bverifica = New System.Windows.Forms.Button()
        Me.Button2 = New System.Windows.Forms.Button()
        CType(Me.DGV, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.InfoValeBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DsAdmingasBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DsAdmingas, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'DGV
        '
        Me.DGV.AllowUserToAddRows = False
        Me.DGV.AllowUserToDeleteRows = False
        Me.DGV.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
            Or System.Windows.Forms.AnchorStyles.Left) _
            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.DGV.AutoGenerateColumns = False
        Me.DGV.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells
        Me.DGV.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText
        Me.DGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.DGV.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.FolioValeDataGridViewTextBoxColumn, Me.NumsDataGridViewTextBoxColumn, Me.FechaVentaDataGridViewTextBoxColumn, Me.FechaSurtidoDataGridViewTextBoxColumn, Me.DenominacionDataGridViewTextBoxColumn, Me.SerieDataGridViewTextBoxColumn, Me.ClienteDataGridViewTextBoxColumn, Me.NumvaleDataGridViewTextBoxColumn, Me.EstadovtDataGridViewTextBoxColumn, Me.FsDataGridViewTextBoxColumn, Me.DataGridViewTextBoxColumn1})
        Me.DGV.DataSource = Me.InfoValeBindingSource
        Me.DGV.Location = New System.Drawing.Point(20, 20)
        Me.DGV.Margin = New System.Windows.Forms.Padding(5)
        Me.DGV.Name = "DGV"
        Me.DGV.ReadOnly = True
        Me.DGV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
        Me.DGV.Size = New System.Drawing.Size(921, 174)
        Me.DGV.TabIndex = 0
        '
        'FolioValeDataGridViewTextBoxColumn
        '
        Me.FolioValeDataGridViewTextBoxColumn.DataPropertyName = "FolioVale"
        Me.FolioValeDataGridViewTextBoxColumn.HeaderText = "FolioVale"
        Me.FolioValeDataGridViewTextBoxColumn.Name = "FolioValeDataGridViewTextBoxColumn"
        Me.FolioValeDataGridViewTextBoxColumn.ReadOnly = True
        Me.FolioValeDataGridViewTextBoxColumn.Width = 108
        '
        'NumsDataGridViewTextBoxColumn
        '
        Me.NumsDataGridViewTextBoxColumn.DataPropertyName = "nums"
        Me.NumsDataGridViewTextBoxColumn.HeaderText = "nums"
        Me.NumsDataGridViewTextBoxColumn.Name = "NumsDataGridViewTextBoxColumn"
        Me.NumsDataGridViewTextBoxColumn.ReadOnly = True
        Me.NumsDataGridViewTextBoxColumn.Width = 77
        '
        'FechaVentaDataGridViewTextBoxColumn
        '
        Me.FechaVentaDataGridViewTextBoxColumn.DataPropertyName = "FechaVenta"
        Me.FechaVentaDataGridViewTextBoxColumn.HeaderText = "FechaVenta"
        Me.FechaVentaDataGridViewTextBoxColumn.Name = "FechaVentaDataGridViewTextBoxColumn"
        Me.FechaVentaDataGridViewTextBoxColumn.ReadOnly = True
        Me.FechaVentaDataGridViewTextBoxColumn.Width = 126
        '
        'FechaSurtidoDataGridViewTextBoxColumn
        '
        Me.FechaSurtidoDataGridViewTextBoxColumn.DataPropertyName = "FechaSurtido"
        Me.FechaSurtidoDataGridViewTextBoxColumn.HeaderText = "FechaSurtido"
        Me.FechaSurtidoDataGridViewTextBoxColumn.Name = "FechaSurtidoDataGridViewTextBoxColumn"
        Me.FechaSurtidoDataGridViewTextBoxColumn.ReadOnly = True
        Me.FechaSurtidoDataGridViewTextBoxColumn.Width = 136
        '
        'DenominacionDataGridViewTextBoxColumn
        '
        Me.DenominacionDataGridViewTextBoxColumn.DataPropertyName = "denominacion"
        Me.DenominacionDataGridViewTextBoxColumn.HeaderText = "denominacion"
        Me.DenominacionDataGridViewTextBoxColumn.Name = "DenominacionDataGridViewTextBoxColumn"
        Me.DenominacionDataGridViewTextBoxColumn.ReadOnly = True
        Me.DenominacionDataGridViewTextBoxColumn.Width = 142
        '
        'SerieDataGridViewTextBoxColumn
        '
        Me.SerieDataGridViewTextBoxColumn.DataPropertyName = "serie"
        Me.SerieDataGridViewTextBoxColumn.HeaderText = "serie"
        Me.SerieDataGridViewTextBoxColumn.Name = "SerieDataGridViewTextBoxColumn"
        Me.SerieDataGridViewTextBoxColumn.ReadOnly = True
        Me.SerieDataGridViewTextBoxColumn.Width = 70
        '
        'ClienteDataGridViewTextBoxColumn
        '
        Me.ClienteDataGridViewTextBoxColumn.DataPropertyName = "cliente"
        Me.ClienteDataGridViewTextBoxColumn.HeaderText = "cliente"
        Me.ClienteDataGridViewTextBoxColumn.Name = "ClienteDataGridViewTextBoxColumn"
        Me.ClienteDataGridViewTextBoxColumn.ReadOnly = True
        Me.ClienteDataGridViewTextBoxColumn.Width = 85
        '
        'NumvaleDataGridViewTextBoxColumn
        '
        Me.NumvaleDataGridViewTextBoxColumn.DataPropertyName = "numvale"
        Me.NumvaleDataGridViewTextBoxColumn.HeaderText = "numvale"
        Me.NumvaleDataGridViewTextBoxColumn.Name = "NumvaleDataGridViewTextBoxColumn"
        Me.NumvaleDataGridViewTextBoxColumn.ReadOnly = True
        Me.NumvaleDataGridViewTextBoxColumn.Width = 101
        '
        'EstadovtDataGridViewTextBoxColumn
        '
        Me.EstadovtDataGridViewTextBoxColumn.DataPropertyName = "Estadovt"
        Me.EstadovtDataGridViewTextBoxColumn.HeaderText = "Estadovt"
        Me.EstadovtDataGridViewTextBoxColumn.Name = "EstadovtDataGridViewTextBoxColumn"
        Me.EstadovtDataGridViewTextBoxColumn.ReadOnly = True
        Me.EstadovtDataGridViewTextBoxColumn.Width = 102
        '
        'FsDataGridViewTextBoxColumn
        '
        Me.FsDataGridViewTextBoxColumn.DataPropertyName = "Fs"
        Me.FsDataGridViewTextBoxColumn.HeaderText = "Fs"
        Me.FsDataGridViewTextBoxColumn.Name = "FsDataGridViewTextBoxColumn"
        Me.FsDataGridViewTextBoxColumn.ReadOnly = True
        Me.FsDataGridViewTextBoxColumn.Width = 53
        '
        'DataGridViewTextBoxColumn1
        '
        Me.DataGridViewTextBoxColumn1.DataPropertyName = "surtido"
        Me.DataGridViewTextBoxColumn1.HeaderText = "surtido"
        Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1"
        Me.DataGridViewTextBoxColumn1.ReadOnly = True
        Me.DataGridViewTextBoxColumn1.Width = 88
        '
        'InfoValeBindingSource
        '
        Me.InfoValeBindingSource.DataMember = "InfoVale"
        Me.InfoValeBindingSource.DataSource = Me.DsAdmingasBindingSource
        '
        'DsAdmingasBindingSource
        '
        Me.DsAdmingasBindingSource.DataSource = Me.DsAdmingas
        Me.DsAdmingasBindingSource.Position = 0
        '
        'DsAdmingas
        '
        Me.DsAdmingas.DataSetName = "DSAdmingas1"
        Me.DsAdmingas.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'TxtVale
        '
        Me.TxtVale.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.TxtVale.Location = New System.Drawing.Point(156, 237)
        Me.TxtVale.Margin = New System.Windows.Forms.Padding(5)
        Me.TxtVale.Name = "TxtVale"
        Me.TxtVale.Size = New System.Drawing.Size(349, 40)
        Me.TxtVale.TabIndex = 1
        Me.TxtVale.Text = ""
        '
        'Label6
        '
        Me.Label6.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.Label6.AutoSize = True
        Me.Label6.Font = New System.Drawing.Font("Bodoni MT Black", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label6.Location = New System.Drawing.Point(306, 209)
        Me.Label6.Margin = New System.Windows.Forms.Padding(5, 0, 5, 0)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(53, 22)
        Me.Label6.TabIndex = 18
        Me.Label6.Text = "Vale"
        '
        'InfoValeTableAdapter
        '
        Me.InfoValeTableAdapter.ClearBeforeFill = True
        '
        'Bcopiar
        '
        Me.Bcopiar.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.Bcopiar.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
        Me.Bcopiar.Font = New System.Drawing.Font("Bodoni MT Black", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Bcopiar.Image = Global.Vales_Verificador_3.My.Resources.Resources.Copiar
        Me.Bcopiar.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.Bcopiar.Location = New System.Drawing.Point(679, 227)
        Me.Bcopiar.Margin = New System.Windows.Forms.Padding(5)
        Me.Bcopiar.Name = "Bcopiar"
        Me.Bcopiar.Size = New System.Drawing.Size(119, 50)
        Me.Bcopiar.TabIndex = 19
        Me.Bcopiar.Text = "Copiar"
        Me.Bcopiar.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.Bcopiar.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage
        Me.Bcopiar.UseVisualStyleBackColor = True
        '
        'Bverifica
        '
        Me.Bverifica.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.Bverifica.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
        Me.Bverifica.Font = New System.Drawing.Font("Bodoni MT Black", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Bverifica.Image = Global.Vales_Verificador_3.My.Resources.Resources.Verificar
        Me.Bverifica.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.Bverifica.Location = New System.Drawing.Point(515, 227)
        Me.Bverifica.Margin = New System.Windows.Forms.Padding(5)
        Me.Bverifica.Name = "Bverifica"
        Me.Bverifica.Size = New System.Drawing.Size(137, 50)
        Me.Bverifica.TabIndex = 2
        Me.Bverifica.Text = " Verificar"
        Me.Bverifica.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.Bverifica.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage
        Me.Bverifica.UseVisualStyleBackColor = True
        '
        'Button2
        '
        Me.Button2.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.Button2.BackgroundImage = Global.Vales_Verificador_3.My.Resources.Resources.salir
        Me.Button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
        Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.Button2.Location = New System.Drawing.Point(888, 237)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(53, 52)
        Me.Button2.TabIndex = 44
        Me.Button2.UseVisualStyleBackColor = True
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(10.0!, 22.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(955, 301)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Bcopiar)
        Me.Controls.Add(Me.TxtVale)
        Me.Controls.Add(Me.Bverifica)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.DGV)
        Me.Font = New System.Drawing.Font("Bodoni MT", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Margin = New System.Windows.Forms.Padding(5)
        Me.Name = "Form1"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Informacion Vale por folio"
        CType(Me.DGV, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.InfoValeBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DsAdmingasBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DsAdmingas, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents DGV As System.Windows.Forms.DataGridView
    Friend WithEvents TxtVale As System.Windows.Forms.RichTextBox
    Friend WithEvents Bverifica As System.Windows.Forms.Button
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents DsAdmingasBindingSource As System.Windows.Forms.BindingSource
    Friend WithEvents DsAdmingas As Vales_Verificador_3.DSAdmingas1
    Friend WithEvents FechaVenta1DataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ImpValeDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents InfoValeBindingSource As System.Windows.Forms.BindingSource
    Friend WithEvents InfoValeTableAdapter As Vales_Verificador_3.DSAdmingas1TableAdapters.InfoValeTableAdapter
    Private Sub Consultar()
        Try
            Dim Vale = Split(TxtVale.Text, "-")
            If Vale.Length < 2 Then
                Throw New Exception("El folio de vale no es valido")
            End If
            Dim Serie = Vale(0)
            Dim Cliente As Long = Vale(1)
            Dim NumV As Long = Vale(2)
            If InfoValeTableAdapter.FillInfoVale(DsAdmingas.InfoVale, Serie, Cliente, NumV) <= 0 Then
                Throw New Exception("El folio de vale no Exite")
            End If
            TxtVale.Text = ""
            TxtVale.Focus()
        Catch ex As Exception
            TxtVale.Text = ""
            TxtVale.Focus()
            MsgBox(ex.Message, MsgBoxStyle.Critical, "Atencion")
        End Try
    End Sub
    Private Sub Bverifica_Click(sender As Object, e As EventArgs) Handles Bverifica.Click
        Consultar()
    End Sub

    Private Sub DGV_RowsAdded(sender As Object, e As DataGridViewRowsAddedEventArgs) Handles DGV.RowsAdded
        DGV.Rows(e.RowIndex).Cells("estadovale").Value = IIf(DGV.Rows(e.RowIndex).Cells("surtido").Value = 1, "Surtido", "Sin surtir")
        If IsDBNull(DGV.Rows(e.RowIndex).Cells("FechaSurtido").Value) Then
            DGV.Rows(e.RowIndex).Cells("fechasurtido").Value = "Desconocido"
        Else
            DGV.Rows(e.RowIndex).Cells("fechasurtido").Value = DsAdmingas.InfoVale(0)("fechasurtido").ToString
        End If
    End Sub
    Private Sub Copiar()
        Dim sb As New System.Text.StringBuilder
        Dim Rows = (From row In DGV.Rows _
                Where Not DirectCast(row, DataGridViewRow).IsNewRow AndAlso row.visible = True _
                Let RowItem = String.Join(",", Array _
                  .ConvertAll( _
                  DirectCast(row, DataGridViewRow).Cells.Cast(Of DataGridViewCell).ToArray, _
                  Function(c As DataGridViewCell) _
                    If(c.Value Is Nothing, "", c.Value.ToString))) _
                Select RowItem).ToArray

        sb = New System.Text.StringBuilder
        For Each row In Rows
            sb.AppendLine(row)
        Next
        Clipboard.SetText(sb.ToString)
        sb = Nothing
        MsgBox("Resultado de la busqueda de vale por folio copiado al portapapeles con exito", MsgBoxStyle.Information, "Hecho")
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        TxtVale.Focus()
        'Dim S = ""
        'For Each C As DataGridViewColumn In DGV.Columns
        '    S = S & (C.Index & " " & C.HeaderText) & vbNewLine
        'Next
        'MsgBox(S)
        With DGV
            .Columns(1).Visible = False
            .Columns(3).Visible = False
            .Columns(5).Visible = False
            .Columns(7).Visible = False
            .Columns(10).Visible = False
            .Columns(6).DisplayIndex = 2
            .Columns(9).DisplayIndex = 4
            .Columns(8).HeaderText = "Estado Vale"
            .Columns(9).HeaderText = "FechaSurtido"
            .Columns(8).Name = "estadovale"
            .Columns(9).Name = "fechasurtido"
            .Columns(10).Name = "surtido"
        End With

    End Sub

    Private Sub TxtVale_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TxtVale.KeyPress
        If e.KeyChar = Chr(13) Then
            e.Handled = True
        End If
    End Sub

    Private Sub TxtVale_KeyUp(sender As Object, e As KeyEventArgs) Handles TxtVale.KeyUp
        If e.KeyData = Keys.Enter And String.IsNullOrEmpty(TxtVale.Text) = False Then
            Consultar()
        End If
    End Sub
    Friend WithEvents SurtidoDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents EstadoDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents FolioValeDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents NumsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents FechaVentaDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents FechaSurtidoDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DenominacionDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents SerieDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ClienteDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents NumvaleDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents EstadovtDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents FsDataGridViewTextBoxColumn As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents Bcopiar As System.Windows.Forms.Button

    Private Sub Bcopiar_Click(sender As Object, e As EventArgs) Handles Bcopiar.Click
        Copiar()
    End Sub
    Friend WithEvents Button2 As System.Windows.Forms.Button

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Me.Close()
    End Sub
End Class
